
class MorphGrailsPlugin {
    def version = 0.1
    def dependsOn = [:]
	def author = "Daniel Latorre"
    def authorEmail = "danilat83@gmail.com"    
	
    def doWithWebDescriptor = { xml ->
        def env = System.getProperty("grails.env")
		if(env=="production"){
			def resourceRef = xml.'resource-ref'
			resourceRef+{
				'description'("Morphlabs Datasource")
				'res-ref-name'("jdbc/morph-ds")
				'res-type'("javax.sql.DataSource")
				'res-auth'("Container")
			}
		}
    }
}
